package com.tucy.logistics.common.enums;

import com.tucy.logistics.common.base.EnumInterface;
import lombok.Getter;

/**
 * author: tcy
 * description:快递状态枚举
 */
@Getter
public enum MailStatusEnum implements EnumInterface {

    ALL("all",0,"全部"),
    NEW("new",1,"新任务"),
    FINISH("finish",2,"已完成"),
    CANCEL("cancel",3,"已取消");

    /**
     * 编码
     */
    private final String code;

    /**
     * 值
     */
    private final Integer value;

    /**
     * 键
     */
    private final String key;

    MailStatusEnum(String code, int value, String key) {
        this.code = code;
        this.value = value;
        this.key = key;
    }

    public static MailStatusEnum getByValue(Integer value) {

        MailStatusEnum baseEnum = null;

        for (MailStatusEnum item : values()) {
            if (item.getValue().equals(value)) {
                baseEnum = item;
                break;
            }
        }
        return baseEnum;
    }

}
